<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-11-28 10:26
 *
 * Version: 2.0
 */

namespace App\Jobs;


use App\Modules\Coupon\Services\CouponService;
use Illuminate\Contracts\Queue\ShouldQueue;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class CouponBackQueue implements ShouldQueue
{
	use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

	private $send_id;
	/**
	 * Create a new job instance.
	 *
	 * @return void
	 */
	public function __construct($sendId)
	{
		$this->send_id = $sendId;
		$this->delay(config('a'));
		$this->onQueue('Coupon');
	}

	/**
	 * Execute the job.
	 *
	 * @return void
	 */
	public function handle(CouponService $couponService)
	{
		$couponService->backNoReceiveCoupon($this->send_id);
	}
}